home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 #32 / q32side1.d64 / t.lil red < prev    next >
Text File  |  2022-08-30  |  12KB  |  234 lines

  1.  
  2.  
  3.               LITTLE RED READER  Version 2.00  (March 8, 1994)
  4.  
  5.         MS-DOS file reader/writer for the C128 and 1571/81/FD drives
  6.  
  7.       Program and Text by Craig Bruce  (csbruce@neumann.uwaterloo.ca)
  8.  
  9.               Interface Changed by Fender Tucker (May 8, 1996)
  10.  
  11.  
  12.  FENDER'S PREMUMBLE: Craig Bruce has introduced several excellent programs
  13. into the Public Domain and this is one of the most useful.  It allows you
  14. to copy files between IBM computers and Commodore computers.  I spent a
  15. couple of delightful May evenings sprucing the program up, interface-wise,
  16. but the guts of the program are all Craig's.  His excellent docs have been
  17. slightly edited to reflect the minor changes I might have made.  Since
  18. Craig's program is PD, this version is also.  Pass it around to your
  19. friends and tell them to thank Craig Bruce and LOADSTAR.
  20.  
  21.  
  22.  This program has been improved over version 1.00 to read and write High
  23. Density MS-DOS disks on the CMD FD-2000 and FD-4000 disk drives.  Just
  24. select drive type "1581" for using these drives.  Since the new version has
  25. greater memory requirements, after starting up "ramdos" (if you use it) you
  26. will have to execute the "graphic clr" BASIC command.
  27.  
  28.  
  29. 1. INTRODUCTION
  30.  
  31. This article presents a program that reads and writes MS-DOS files and the
  32. root directory of MS-DOS disks.  The program copies only from drive to
  33. drive without buffering file data internally.  This is simpler and imposes
  34. no limits on the size of the files transferred, although it requires the
  35. use of two disk drives (or a logical drive).  The user-interface code is
  36. written in BASIC and presents a full-screen file selection menu.  The
  37. grunt-work code is written in assembly language and operates at maximum
  38. velocity.
  39.  
  40. The program also allows MS-DOS files to be deleted and allows the copying
  41. of Commodore-DOS files between CBM-DOS disks (this makes it more convenient
  42. to use the program with a temporary logical drive like RAMDOS). Also, since
  43. I have a CMD FD-4000 floppy disk drive, I know that this program works with
  44. MS-DOS disks with this drive (for both the 720K and 1.44M MS-DOS formats).
  45. The FD disk drives are logically referred to below as being the 1581.
  46.  
  47. The Burst Command Instruction Set of the 1571/81 is used to read the MS-DOS
  48. disk blocks and the standard kernel routines are used for outputting the
  49. data.  (I am an operating systems specialist, so I call it a kernEl!) Thus,
  50. the MS-DOS files must be read from a 1571 or 1581 disk drive, but the
  51. output device may be any disk drive type, the screen or a printer, or a
  52. virtual drive type such as RAMLink, RAMDrive, or RAMDOS (for the REU).  It
  53. is interesting to note that the data can be read in from an MS-DOS disk
  54. faster than it can be written out to a 1571, 1581, or even a RAMDOS file. A
  55. RAMLink can swallow the data only slightly faster than it can be read.
  56.  
  57. Little Red Reader (LRR) supports double density 3.5" disks formatted with
  58. 80 tracks, 9 sectors per track, and 2 sides with a 1581 and 5.25" double
  59. density disks formatted with 40 tracks, 9 sectors per track, and 2 sides
  60. with a 1571, and now, high density 3.5" disks formatted with 80 tracks, 18
  61. sectors per track, 2 sides, and a "12-bit FAT".  A limit of 224 directory
  62. entries and 9 File Allocation Table (FAT) sectors is imposed.  There must
  63. be 2 copies of the FAT and the cluster size may be 1 or 2 sectors.  The
  64. sector size must be 512 bytes.
  65.  
  66. The program runs on either the 40 or 80-column screens, but you will get
  67. much better performance from the BASIC portion of the program by being in
  68. 80-column mode and FAST mode.  A modification that someone might want to
  69. make would be to spread-out the display for the 80-column screen and add
  70. color to the rather bland display.
  71.  
  72.  FENDER'S NOTE: Maybe blushing pink and crime-scene red weren't the colors
  73. you had in mind, Craig, but you asked for it.  I must say that your code
  74. was a pleasure to edit.
  75.  
  76. Oh, about the name.  It is a play on the name of another MS-DOS file copier
  77. available for the C-128.  "Little" means that it is smaller in scope than
  78. the other program, and "Red" is a different primary color to avoid any
  79. legal complications.  It is also the non-white color of the flag of the
  80. country of origin of this program (no, I am not Japanese).  Also, this
  81. program is Public Domain Software, as is all software I develop for 8-bit
  82. Commodore Computers. Feel free to E-mail me if you have questions or
  83. comments about this article.
  84.  
  85.  
  86. 2. USER GUIDE
  87.  
  88. LOAD and RUN the "lil red" BASIC program file.  When the program is first
  89. run, it will load in the binary machine language package from the "current"
  90. Commodore DOS drive (the current drive is obtained from PEEK(186) - the
  91. last device accessed).  The binary package is loaded only on the first run
  92. and is not reloaded on subsequent runs if the package ID field is in
  93. place.
  94.  
  95. The system is designed to have two file selection menus: one for the MS-DOS
  96. disk drive, and one for the Commodore-DOS disk drive (which may be a
  97. logical disk drive).  The idea for copying is that you select the files in
  98. one of these menus, and then the program knows to copy them to the disk for
  99. the other menu.
  100.  
  101.  
  102. 2.1. MS-DOS MENU
  103.  
  104. The main screen of the program is first displayed.  The main screen of the
  105. program will look something like this:
  106.  
  107.  
  108.    NUM  S  TRN  TYP  FILENAME  EXT  LENGTH
  109.    ---  -  ---  ---  --------  ---  ------
  110.      1  *  ASC  SEQ  HACK4     TXT  120732
  111.      2     BIN  PRG  RAMDOS    SFX   34923
  112.  
  113.    MS-DOS    MS = 10:1581    CBM = 8   BYTES FREE:231456
  114.  
  115.    D - Directory  M - MS Device  F - CBM Device  C - Copy  Q=Quit
  116.    T - Toggle All  R - Remove  X - CBM Copy  / - Switch  +/- Page
  117.  
  118. except that immediately after starting up, "Directory not loaded" will be
  119. displayed rather than filenames.  The "MS" fields give the device number
  120. and type of the drive containing the MS-DOS disk to copy from, and the
  121. "CBM" gives the device number of the drive/virtual drive/character device
  122. to copy file data to.  The number of bytes free on the drive are also
  123. displayed (which is useful to know when writing files) and there are some
  124. more commands.
  125.  
  126. Information about all MS-DOS files in the root directory of the MS-DOS disk
  127. is displayed in columns below the drive information.  "NUM" gives the
  128. number of the MS-DOS file in the directory listing, and "S" indicates
  129. whether the file is "selected" or not.  If the file is selected, an
  130. asterisk (*) is displayed; otherwise, a blank is displayed.  When you later
  131. enter Copy Mode, only the files that have been "selected" are copied.
  132.  
  133. The "TRN" field indicates the character translation scheme to be used when
  134. the file is copied.  A value of "BIN" (binary) means no translation and a
  135. value of "ASC" (ascii) means the file characters are to be translated from
  136. MS-DOS ASCII (or "ASCII-CrLf") to PETSCII.  The "TYP" field indicates the
  137. type of Commodore-DOS file to create for writing the MS-DOS file contents
  138. into.  The possible values are "SEQ" (sequential) and "PRG" (program).  The
  139. values of the TRN and TYP fileds are set independently, so you can copy
  140. binary data to SEQ files and ascii data to PRG files if you wish.
  141.  
  142. The "FILENAME" and "EXT" fields give the filename and extension type of the
  143. MS-DOS files and "LENGTH" gives the exact length of the files in bytes.
  144. Note that if you perform "ASC" translation on a file, its PETSCII version
  145. will have a shorter length.
  146.  
  147.  FENDER'S NOTE: Since I am more comfortable with "blocks" rather than
  148. "bytes" on a CBM disk, I changed the CBM directory to show blocks free
  149. rather than bytes free.  Change line 720 if you prefer bytes for both
  150. formats.
  151.  
  152.  
  153. 2.2. USER COMMANDS
  154.  
  155. The bottom of the screen gives the command summary.  After starting the
  156. program, you will want to set up the MS-DOS and CBM-DOS drives with the "M"
  157. and "F" commands.  Simply press the (letter) key corresponding to the
  158. command name to activate the command.  Pressing M will prompt you for the
  159. MS-DOS Drive Number and the MS-DOS Drive Type.  In both cases, type the
  160. number and press RETURN.  (Sorry for insulting all non-novices out there,
  161. but I want to be complete).  The MS-DOS drive number cannot be the same as
  162. the CBM-DOS drive number (since the program copies from drive-to-drive
  163. without internal